if (!("finalizeConstruction" in ViewPU.prototype)) {
    Reflect.set(ViewPU.prototype, "finalizeConstruction", () => { });
}
import router from "@ohos.router";
export class EcDeviceTip extends ViewPU {
    constructor(q17, r17, s17, t17 = -1, u17 = undefined, v17) {
        super(q17, s17, t17, v17);
        if (typeof u17 === "function") {
            this.paramsGenerator_ = u17;
        }
        this.__topHeight = this.createStorageProp('topHeight', 0, "topHeight");
        this.type = 'success';
        this.message = '';
        this.closeUrl = 'pages/Index';
        this.url = '';
        this.btnText = '继续安装';
        this.setInitiallyProvidedValue(r17);
        this.finalizeConstruction();
    }
    setInitiallyProvidedValue(p17) {
        if (p17.type !== undefined) {
            this.type = p17.type;
        }
        if (p17.message !== undefined) {
            this.message = p17.message;
        }
        if (p17.closeUrl !== undefined) {
            this.closeUrl = p17.closeUrl;
        }
        if (p17.url !== undefined) {
            this.url = p17.url;
        }
        if (p17.btnText !== undefined) {
            this.btnText = p17.btnText;
        }
    }
    updateStateVars(o17) {
    }
    purgeVariableDependenciesOnElmtId(n17) {
        this.__topHeight.purgeDependencyOnElmtId(n17);
    }
    aboutToBeDeleted() {
        this.__topHeight.aboutToBeDeleted();
        SubscriberManager.Get().delete(this.id__());
        this.aboutToBeDeletedInternal();
    }
    get topHeight() {
        return this.__topHeight.get();
    }
    set topHeight(m17) {
        this.__topHeight.set(m17);
    }
    initialRender() {
        this.observeComponentCreation2((k17, l17) => {
            Column.create();
            Column.width('100%');
            Column.padding({ top: this.topHeight });
            Column.backgroundColor({ "id": -1, "type": 10001, params: ['app.color.yk_mid_bg'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
        }, Column);
        this.observeComponentCreation2((g17, h17) => {
            Row.create();
            Row.width('100%');
            Row.padding({ left: 24 });
            Row.height(56);
            Row.onClick(() => {
                router.pushUrl({ url: this.closeUrl }, () => {
                    router.clear();
                });
            });
        }, Row);
        this.observeComponentCreation2((e17, f17) => {
            Image.create({ "id": -1, "type": 20000, params: ['app.media.btn_clean'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
            Image.width(24);
            Image.aspectRatio(1);
        }, Image);
        Row.pop();
        this.observeComponentCreation2((c17, d17) => {
            Column.create();
            Column.width('100%');
            Column.backgroundColor('#fff');
        }, Column);
        this.observeComponentCreation2((a17, b17) => {
            Image.create(this.type === 'success' ? { "id": -1, "type": 20000, params: ["app.media.img_success"], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" } : { "id": -1, "type": 20000, params: ["app.media.img_fail"], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
            Image.width(152);
            Image.aspectRatio(1);
            Image.margin({ top: 20, bottom: 15 });
        }, Image);
        this.observeComponentCreation2((y16, z16) => {
            Text.create(this.message);
            Text.fontColor({ "id": -1, "type": 10001, params: ['app.color.yk_mid_19'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
            Text.fontSize(18);
            Text.fontWeight(600);
        }, Text);
        Text.pop();
        this.observeComponentCreation2((u16, v16) => {
            Button.createWithLabel(this.btnText);
            Button.margin({ top: 50 });
            Button.width(230);
            Button.height(40);
            Button.backgroundColor({ "id": -1, "type": 10001, params: ['app.color.yk_main_color'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
            Button.onClick(() => {
                if (this.url) {
                    router.pushUrl({ url: this.url }, () => {
                        router.clear();
                    });
                }
                else {
                    router.back();
                }
            });
        }, Button);
        Button.pop();
        Column.pop();
        Column.pop();
    }
    rerender() {
        this.updateDirtyElements();
    }
}
